<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="js/react.development.js"></script>
    <script src="js/react-dom.development.js"></script>
    <script src="js/babel.min.js"></script>

     <style>
        .box{
            width: 500px;
            background-color: skyblue;
        }
     </style>
</head>
<body>
 
    <div id="demo"></div>
    
    <script type="text/babel">

        //创建虚拟dom两种方式
    
            
       //1、使用存js 创建虚拟dom

    //    var vLi= React.createElement('li',{class:'li'},'北京');
    //    var vUl= React.createElement('ul',{class:'ul'},vLi);
    //    var vDom= React.createElement('div',{id:'box',class:'box'},vUl);

    //    ReactDOM.render(vDom,document.getElementById('demo'));


       //2、使用jsx 创建虚拟dom

       var title="react";

       var vDom=(<div className="box">
          <h1 style={{color:'#ff0000',fontSize:'60px'}}>{title.toUpperCase()}</h1>
          <ul>
              <li>北京</li>
              <li>上海</li>
            </ul>
        </div>
        )
    
        ReactDOM.render(vDom,document.getElementById('demo'));

    
       
    </script>
    
</body>
</html>